package hy.controller;

import hy.beans.User;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;

//@Controller
////@ResponseBody
@RestController
@RequestMapping("/c2")
public class C2 {

    @RequestMapping("/m1")
    public String m1(){
        return "this is m1";
    }

    @PostMapping("/m2")
    public String m2(HttpServletRequest req, String username,@RequestParam(value = "password",required = true) String pass, User u){
//        System.out.println(req.getParameter("username"));
        System.out.println(pass);
        System.out.println(u);
        return "this is get mapping,only for get method";
    }

}
